# gtkdialog
# Builds from https://github.com/puppylinux-woof-CE/petbuilds

. ../func
. ../build.conf

URL=http://distro.ibiblio.org/puppylinux/sources/g/
PKG=gtkdialog
VER=0.8.4
COMP=tar.xz
DESC="gtkialog is a small utility for fast and easy GUI building"
DEPS=+gtk+2
CAT=BuildingBlock
BUILD=
CWD=$(pwd)
[ -z "$MWD" ] && MWD=$(dirname $CWD)	
[ -z "$BUILD" ] && BUILD=$DEF_BUILD
[ -f "$DESKTOP" ] || DESKTOP=not
[ -z "$DEPS" ] && DEPS=not	

ARCH=$(uname -m)
case $ARCH in
 *64) 	LIBDIR=$LIBCONF64 ;;
 arm*)	LIBDIR=$LIBCONFarm;;
 *) 	LIBDIR=$LIBCONF32 ;;
esac

build() {
	cd ${PKG}-${VER}
	./configure --prefix=/usr \
				--localstatedir=/var \
				--sysconfdir=/etc \
				--libdir=/usr/${LIBDIR} \
				--bindir=/usr/sbin \
				--enable-maintainer-mode
	[ "$?" -eq 0 ] || exit 1
	make $MKFLG
	[ "$?" -eq 0 ] || exit 1
	make DESTDIR=$CWD/$PKG-install install
	cd -
}
	
package_ext() {
	EXAMPLES=`find . -type d -name 'examples'`
	DOCS=`find . -type d -name 'reference'`
	install -d -m 0755 ${PKG}-install/usr/share/doc/gtkdialog
	cp -arf $EXAMPLES ${PKG}-install/usr/share/doc/gtkdialog/
	cp -arf $DOCS ${PKG}-install/usr/share/doc/gtkdialog/
}

# main
retrieve ${PKG}-${VER}.${COMP}
extract ${PKG}-${VER}.${COMP}
build
package_ext
package_std $PKG $VER $ARCH $DESKTOP "$DESC" $DEPS $CAT	
